from senweaver.core.models import PKMixin, BaseMixin,AuditMixin
from senweaver.utils.partial import optional
{{ imports }}

class {{ model_name }}Base(SQLModel):   
    {%- if rendered_column_attributes %}
    {% for line in rendered_column_attributes %}
        {%- if line %}{{ line }}{% endif %}
    {% endfor %}
    {%- endif %}

{{render_class}}    

class {{ model_name }}(BaseMixin, {{ model_name }}Base, PKMixin, table=True):    
    __tablename__ = "{{ table_name }}"
    {%- if table_args -%}
    {% set indent = "    " %}  
    __table_args__ = (
        {% for arg in table_args %}
        {%- if arg %}{{ arg }},{% endif %}
        {% endfor %})
    {%- endif %}    
    {# Render relationship attributes #}
    {%- if rendered_relationship_attributes %}
    {% for line in rendered_relationship_attributes %}
        {%- if line %}{{ line }}{% endif %}
    {% endfor %}
    {%- endif %}


class {{ model_name }}Read(AuditMixin, {{ model_name }}Base, PKMixin):
    pass


class {{ model_name }}Create({{ model_name }}Base):
    pass


class {{ model_name }}CreateInternal({{ model_name }}Base):
    pass

@optional()
class {{ model_name }}Update({{ model_name }}Base):
    pass


class {{ model_name }}UpdateInternal({{ model_name }}Update):
    pass
